<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<!--
Copyright (C) 2010 Calin Radoni

This file is part of CHScanner.

CHScanner is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

CHScanner is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with CHScanner. If not, see <http://www.gnu.org/licenses/>.
-->

  <xsl:output method="html"/>

	<xsl:template match="/">
		<html>
			<head>
				<title>
					<xsl:value-of select="CHScannerDoc/pageTitle"/>
				</title>
				<link rel="stylesheet" type="text/css" href="css/style.css"/>
			</head>
			<body>
				<xsl:apply-templates select="CHScannerDoc/version"/>
				<xsl:apply-templates select="CHScannerDoc/timestamp"/>

        <br/>
        
        <xsl:for-each select="CHScannerDoc/result">
          <xsl:element name="a">
            <xsl:attribute name="class">resultTOC</xsl:attribute>
            <xsl:attribute name="href">#<xsl:value-of select="@id"/></xsl:attribute>
            <xsl:attribute name="target">_self</xsl:attribute>
            <xsl:choose>
              <xsl:when test="string-length(addrIP) &gt; 0">
                <xsl:value-of select="addrIP"/>
              </xsl:when>
              <xsl:when test="string-length(addrIPv6) &gt; 0">
                <xsl:value-of select="addrIPv6"/>
              </xsl:when>
              <xsl:when test="string-length(addrIPX) &gt; 0">
                <xsl:value-of select="addrIPX"/>
              </xsl:when>
              <xsl:when test="string-length(addrMAC) &gt; 0">
                <xsl:value-of select="addrMAC"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="@id"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:element>

          <xsl:if test="position()!=last()">
            <xsl:text> </xsl:text>
          </xsl:if>
        </xsl:for-each>

        <xsl:if test="CHScannerDoc/globalInfo">
          <a class="resultTOC" href="#glbInf" target="_self">GlobalInfo</a>
        </xsl:if>
        
        <a class="resultTOC" href="#wcfgp" target="_self">Parameters</a>

        <br/>
        <br/>

        <hr class="Hr"/>

        <xsl:for-each select="CHScannerDoc/result">
					<xsl:apply-templates select="."/>
				</xsl:for-each>
        <xsl:apply-templates select="CHScannerDoc/globalInfo"/>
				<xsl:apply-templates select="CHScannerDoc/workCfg"/>
			</body>
		</html>
	</xsl:template>

<!-- pageTitle -->
	<xsl:template match="pageTitle"/>

<!-- version -->
	<xsl:template match="version">
		<div class="divBanner">
			<xsl:text>Scanned with CHScanner, version </xsl:text>
			<xsl:value-of select="vNumber"/>
		</div>
	</xsl:template>
	
<!-- timestamp -->
	<xsl:template match="timestamp">
		<div class="divBannerSub">
			<xsl:text>Date: </xsl:text>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	
<!-- workCfg -->
	<xsl:template match="workCfg">
		<hr class="Hr"/>
    <a name="wcfgp"/>
		<xsl:choose>
			<xsl:when test="@type[.='passive']">
        <b><xsl:text>Work configuration's parameters:</xsl:text></b>
				<xsl:text> Passive scan.</xsl:text>
			</xsl:when>
      <xsl:when test="@type[.='hunt']">
        <b><xsl:text>Work configuration's parameters:</xsl:text></b>
        <xsl:text> Hunt mode scan.</xsl:text>
      </xsl:when>
      <xsl:otherwise>
        <b><xsl:text>Work configuration's parameters:</xsl:text></b>
				<ul>
					<xsl:apply-templates/>
				</ul>
			</xsl:otherwise>
		</xsl:choose>
		<hr class="Hr"/>
	</xsl:template>
	
	<xsl:template match="cFileName">
		<li>
      <xsl:text>File name: </xsl:text>
      <xsl:value-of select="."/>
    </li>
	</xsl:template>
	<xsl:template match="cDescription">
    <li>
      <xsl:text>Description: </xsl:text>
      <xsl:value-of select="."/>
    </li>
	</xsl:template>
	<xsl:template match="cComment">
		<li>
      <xsl:text>Comment: </xsl:text>
      <xsl:value-of select="."/>
    </li>
	</xsl:template>
	<xsl:template match="cAddressSpace">
		<li>
      <xsl:text>Address space: </xsl:text>
      <xsl:value-of select="."/>
    </li>
	</xsl:template>
	<xsl:template match="cScanAll">
		<li>
      <xsl:text>Scan space: </xsl:text>
      <xsl:value-of select="."/>
    </li>
	</xsl:template>
	<xsl:template match="cScanOrder">
		<li>
      <xsl:text>Scan order: </xsl:text>
      <xsl:value-of select="."/>
    </li>
	</xsl:template>
	<xsl:template match="cMaxSimScanG">
		<li>
      <xsl:text>Max.Sim.Scan: </xsl:text>
      <xsl:value-of select="."/>
    </li>
	</xsl:template>
	<xsl:template match="cMaxSimScanD">
		<li>
      <xsl:text>Max.Sim.Scan DNS: </xsl:text>
      <xsl:value-of select="."/>
    </li>
	</xsl:template>
	<xsl:template match="cMaxSimScanI">
		<li>
      <xsl:text>Max.Sim.Scan ICMP: </xsl:text>
      <xsl:value-of select="."/>
    </li>
	</xsl:template>
	<xsl:template match="cMaxWaitTime">
		<li>
      <xsl:text>Max.Wait Time: </xsl:text>
      <xsl:value-of select="."/>
      <xsl:text> ms</xsl:text>
    </li>
	</xsl:template>
	
<!-- result -->
	<xsl:template match="result">
		<p align="left">
      <xsl:element name="a">
        <xsl:attribute name="name">
          <xsl:value-of select="@id"/>
        </xsl:attribute>
      </xsl:element>
      
      <xsl:if test="string-length(addrIP) &gt; 0">
        <b><xsl:value-of select="addrIP"/></b><br/>  
      </xsl:if>
      <xsl:if test="string-length(addrIPv6) &gt; 0">
        <b><xsl:value-of select="addrIPv6"/></b><br/>
      </xsl:if>

			<xsl:apply-templates/>
		</p>
	</xsl:template>

<!-- addrIP is skipped because it's content is displayed in "result"-->
	<xsl:template match="addrIP"/>

<!-- addrIPv6 is skipped because it's content is displayed in "result"-->
  <xsl:template match="addrIPv6"/>

	<xsl:template match="addrMAC">
		<xsl:choose>
			<xsl:when test="@type[.='Arp']">
				<xsl:text>MAC is </xsl:text>
				<xsl:value-of select="."/>
			</xsl:when>
			<xsl:when test="@type[.='NetBios']">
				<xsl:text>MAC is </xsl:text>
				<xsl:value-of select="."/>
				<xsl:text>, by NetBios</xsl:text>
			</xsl:when>
			<xsl:otherwise/>
		</xsl:choose>
    <xsl:if test="@vendor">
      <xsl:text> (</xsl:text>
      <xsl:value-of select="@vendor"/>
      <xsl:text>)</xsl:text>
    </xsl:if>
    <br/>
  </xsl:template>
  
<!-- addrIPX-->
  <xsl:template match="addrIPX">
    <xsl:text>IPX Address: </xsl:text>
    <xsl:value-of select="."/>
  </xsl:template>
  
<!-- countryCode -->
  <xsl:template match="countryCode">
    <xsl:text>Country Code: </xsl:text>
    <xsl:value-of select="."/>
  </xsl:template>
  
<!--SSDP-->
  <xsl:template match="ssdp">
    <xsl:text>The host is a SSDP broadcaster</xsl:text>
  </xsl:template>

<!--Stopped-->
  <xsl:template match="stopped">
    <xsl:text>The host was stopped</xsl:text>
  </xsl:template>
  
<!-- dnsNames -->
  <xsl:template match="dnsNames">
    <div class="{name(.)}">
      <xsl:text>DNS Names:</xsl:text>
      <ul class="{name(.)}">
        <xsl:apply-templates/>
      </ul>
    </div>
  </xsl:template>

  <xsl:template match="dnsName">
    <li>
      <xsl:value-of select="dnsNameType"/>
      <xsl:text>: </xsl:text>
      <xsl:value-of select="dnsNameValue"/>
      <xsl:text>, TTL </xsl:text>
      <xsl:value-of select="dnsNameTTL"/>
    </li>
  </xsl:template>

  <xsl:template match="dnsNameType"/>
  <xsl:template match="dnsNameValue"/>
  <xsl:template match="dnsNameTTL"/>

<!-- NetBios Infos -->	
	<xsl:template match="netBios">
		<div class="{name(.)}">
			<xsl:text>NetBios Informations:</xsl:text>
			<ul class="{name(.)}">
				<xsl:apply-templates/>
			</ul>
		</div>
	</xsl:template>
	
	<xsl:template match="netBiosName">
		<li>
			<xsl:value-of select="."/>
		</li>
	</xsl:template>

<!-- Shares Infos -->
  <xsl:template match="shares">
    <div class="{name(.)}">
      <xsl:text>Shares:</xsl:text>
      <ul class="{name(.)}">
        <xsl:apply-templates/>
      </ul>
    </div>
  </xsl:template>

  <xsl:template match="shareInfo">
    <li>
      <xsl:value-of select="."/>
    </li>
  </xsl:template>

<!-- SNMP Infos -->
	<xsl:template match="snmpSysInfo">
		<div class="{name(.)}">
			<xsl:text>SNMP System Informations:</xsl:text>
			<ul>
				<xsl:apply-templates/>
			</ul>
		</div>
	</xsl:template>
	
	<xsl:template match="snmpSysInfoItem">
		<li>
			<xsl:choose>
				<xsl:when test="@type[.='Description']">
					<xsl:text>Description: </xsl:text>
				</xsl:when>
				<xsl:when test="@type[.='VendorOID']">
					<xsl:text>Vendor OID: </xsl:text>
				</xsl:when>
				<xsl:when test="@type[.='Contact']">
					<xsl:text>Contact: </xsl:text>
				</xsl:when>
				<xsl:when test="@type[.='Name']">
					<xsl:text>Name: </xsl:text>
				</xsl:when>
				<xsl:when test="@type[.='Location']">
					<xsl:text>Location: </xsl:text>
				</xsl:when>
				<xsl:when test="@type[.='UpTime']">
					<xsl:text>Up time: </xsl:text>
				</xsl:when>
				<xsl:when test="@type[.='Services']">
					<xsl:text>Services: </xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>unknown </xsl:text>
				</xsl:otherwise>
			</xsl:choose>
			<xsl:value-of select="."/>
		</li>
	</xsl:template>

  <!-- DHCP Infos -->
  <xsl:template match="dhcpInfo">
    <div class="{name(.)}">
      <xsl:text>DHCP Informations:</xsl:text>
      <ul>
        <xsl:apply-templates/>
      </ul>
    </div>
  </xsl:template>

  <xsl:template match="dhcpInfoItem">
    <li>
      <xsl:choose>
        <xsl:when test="@type[.='yiAddr']">
          <xsl:text>Offered IP address: </xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='chAddr']">
          <xsl:text>Client hardware address: </xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='siAddr']">
          <xsl:text>Server identifier: </xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='giAddr']">
          <xsl:text>Relay agent IP: </xsl:text>
        </xsl:when>
      </xsl:choose>
      <xsl:value-of select="."/>
    </li>
  </xsl:template>

  <xsl:template match="dhcpInfoOption">
    <li>
      <xsl:text>Option </xsl:text>
      <xsl:value-of select="dhcpInfoOptionId"/>
      <xsl:text> (</xsl:text>
      <xsl:value-of select="dhcpInfoOptionName"/>
      <xsl:text>): </xsl:text>
      <xsl:value-of select="dhcpInfoOptionValue"/>
    </li>
  </xsl:template>

  <!-- Promiscuous Node Informations-->
  <xsl:template match="promiscInfo">
    <div class="{name(.)}">
      <xsl:text>Promiscuous Node scan has received replies for:</xsl:text>
      <ul>
        <xsl:apply-templates/>
      </ul>
    </div>
  </xsl:template>
  
  <xsl:template match="promiscInfoItem">
    <li>
      <xsl:choose>
        <xsl:when test="@type[.='bCast47']">
          <xsl:text>Broadcast 47 bits</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='bCast16']">
          <xsl:text>Broadcast 16 bits</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='bCast8']">
          <xsl:text>Broadcast 8 bits</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='GroupBit']">
          <xsl:text>Group bit set</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='mCast0']">
          <xsl:text>Multicast address 0</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='mCast1']">
          <xsl:text>Multicast address 1</xsl:text>
        </xsl:when>
      </xsl:choose>
    </li>
  </xsl:template>

  <!-- IGMP Informations -->
  <xsl:template match="igmpInfo">
    <div class="{name(.)}">
      <xsl:text>IGMP Informations</xsl:text>
      <ul>
        <xsl:apply-templates/>
      </ul>
    </div>
  </xsl:template>

  <xsl:template match="igmpInfoItem">
    <li>
      <xsl:value-of select="."/>
      <xsl:if test="@assignment">
        <xsl:text> (</xsl:text>
        <xsl:value-of select="@assignment"/>
        <xsl:text>)</xsl:text>
      </xsl:if>
      <xsl:text> - </xsl:text>
      <xsl:choose>
        <xsl:when test="@type[.=0]">
          <xsl:text>uninitialized</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.=17]">
          <xsl:text>Membership Query</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.=18]">
          <xsl:text>Version 1 Membership Report</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.=22]">
          <xsl:text>Version 2 Membership Report</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.=23]">
          <xsl:text>Version 2 Leave Group</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.=34]">
          <xsl:text>Version 3 Membership Report</xsl:text>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>unknown</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:if test="@recordType">
        <xsl:text>, </xsl:text>
        <xsl:choose>
          <xsl:when test="@recordType[.=1]">
            <xsl:text>Mode is Include</xsl:text>
          </xsl:when>
          <xsl:when test="@recordType[.=2]">
            <xsl:text>Mode is Exclude</xsl:text>
          </xsl:when>
          <xsl:when test="@recordType[.=3]">
            <xsl:text>Change to Include mode</xsl:text>
          </xsl:when>
          <xsl:when test="@recordType[.=4]">
            <xsl:text>Change to Exclude mode</xsl:text>
          </xsl:when>
          <xsl:when test="@recordType[.=5]">
            <xsl:text>Allow New Sources</xsl:text>
          </xsl:when>
          <xsl:when test="@recordType[.=6]">
            <xsl:text>Block Old Sources</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <xsl:text>unknown record type</xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:if>
    </li>
  </xsl:template>

  <!-- GVRP Informations -->
  <xsl:template match="gvrpInfo">
    <div class="{name(.)}">
      <xsl:choose>
        <xsl:when test="@name">
          <xsl:text>GVRP </xsl:text>
          <xsl:value-of select="@name"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>GVRP Informations</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
      <ul>
        <xsl:apply-templates/>
      </ul>
    </div>
  </xsl:template>

  <xsl:template match="gvrpInfoItem">
    <li>
      <xsl:if test="@type">
        <xsl:value-of select="@type"/>
        <xsl:text>: </xsl:text>
      </xsl:if>
      <xsl:value-of select="."/>
    </li>
  </xsl:template>

  <!-- GMRP Informations -->
  <xsl:template match="gmrpInfo">
    <div class="{name(.)}">
      <xsl:choose>
        <xsl:when test="@name">
          <xsl:text>GMRP </xsl:text>
          <xsl:value-of select="@name"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>GMRP Informations</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
      <ul>
        <xsl:apply-templates/>
      </ul>
    </div>
  </xsl:template>

  <xsl:template match="gvrpInfoItem">
    <li>
      <xsl:if test="@type">
        <xsl:value-of select="@type"/>
        <xsl:text>: </xsl:text>
      </xsl:if>
      <xsl:value-of select="."/>
    </li>
  </xsl:template>

  <!-- CDP Informations -->
  <xsl:template match="cdpInfo">
    <div class="{name(.)}">
      <xsl:choose>
        <xsl:when test="@name">
          <xsl:text>CDP </xsl:text>
          <xsl:value-of select="@name"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>CDP Informations</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
      <ul>
        <xsl:apply-templates/>
      </ul>
    </div>
  </xsl:template>

  <xsl:template match="cdpInfoItem">
    <li>
      <xsl:if test="@type">
        <xsl:value-of select="@type"/>
        <xsl:text>: </xsl:text>
      </xsl:if>
      <xsl:value-of select="."/>
    </li>
  </xsl:template>

  <!-- STP Informations -->
  <xsl:template match="stpInfo">
    <div class="{name(.)}">
      <xsl:choose>
        <xsl:when test="@name">
          <xsl:text>STP </xsl:text>
          <xsl:value-of select="@name"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>STP Informations</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
      <ul>
        <xsl:apply-templates/>
      </ul>
    </div>
  </xsl:template>

  <xsl:template match="stpInfoItem">
    <li>
      <xsl:if test="@type">
        <xsl:value-of select="@type"/>
        <xsl:text>: </xsl:text>
      </xsl:if>
      <xsl:value-of select="."/>
    </li>
  </xsl:template>

  <!-- DTP Informations -->
  <xsl:template match="dtpInfo">
    <div class="{name(.)}">
      <xsl:choose>
        <xsl:when test="@name">
          <xsl:text>DTP </xsl:text>
          <xsl:value-of select="@name"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>DTP Informations</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
      <ul>
        <xsl:apply-templates/>
      </ul>
    </div>
  </xsl:template>

  <xsl:template match="dtpInfoItem">
    <li>
      <xsl:if test="@type">
        <xsl:value-of select="@type"/>
        <xsl:text>: </xsl:text>
      </xsl:if>
      <xsl:value-of select="."/>
    </li>
  </xsl:template>

  <!-- Method -->
	<xsl:template match="method">
		<div class="divMethod">
		<div class="divMethodName">
			<xsl:if test="@name">
				<xsl:text>Method </xsl:text>
				<xsl:value-of select="@name"/>
			</xsl:if>
			<xsl:if test="@respReceived[.='0']">
				<div class="divMethodNoRespRecv">
					<xsl:text>(NO response received)</xsl:text>
				</div>
			</xsl:if>
		</div>
		<xsl:apply-templates/>
		</div>
	</xsl:template>
	
	<xsl:template match="methodResult">
		<xsl:apply-templates/><br/>
	</xsl:template>
	<xsl:template match="methodPort">
		<xsl:text>Port </xsl:text>
		<xsl:value-of select="."/>
	</xsl:template>
  <xsl:template match="methodPortName">
    <xsl:text> (</xsl:text>
    <xsl:value-of select="."/>
    <xsl:text>)</xsl:text>
  </xsl:template>
  <xsl:template match="methodTime">
		<xsl:text>, response time </xsl:text>
		<xsl:value-of select="."/>
		<xsl:text>ms</xsl:text>
	</xsl:template>
	<xsl:template match="methodProtocol">
		<xsl:text>Protocol </xsl:text>
		<xsl:value-of select="."/>
	</xsl:template>

  <!-- globalInfo -->
  <xsl:template match="globalInfo">
    <hr class="Hr"/>
    <a name="glbInf"/>
    <b>
      <xsl:text>Global Info</xsl:text>
      <br/>
      <br/>
    </b>
    <xsl:apply-templates select="giEthCnt"/>
    <xsl:apply-templates select="giNTP"/>
  </xsl:template>

  <!-- giEthCnt -->
  <xsl:template match="giEthCnt">
    <xsl:text>Ethernet Counters</xsl:text>
    <ul>
      <xsl:apply-templates select="gieCnt"/>
    </ul>
  </xsl:template>

  <!-- gieCnt -->
  <xsl:template match="gieCnt">
    <li>
      <xsl:choose>
        <xsl:when test="@type[.='Arp']">
          <xsl:text>ARP</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Tcp4']">
          <xsl:text>IPv4 TCP</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Udp4']">
          <xsl:text>IPv4 UDP</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Icmp4']">
          <xsl:text>IPv4 ICMP</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Other4']">
          <xsl:text>IPv4 Other</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Tcp6']">
          <xsl:text>IPv6 TCP</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Udp6']">
          <xsl:text>IPv6 UDP</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Icmp6']">
          <xsl:text>IPv6 ICMP</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Other6']">
          <xsl:text>IPv6 Other</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Other']">
          <xsl:text>Ethernet Other</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Total']">
          <xsl:text>TOTAL</xsl:text>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>Unknown</xsl:text>
        </xsl:otherwise>
      </xsl:choose>

      <xsl:text>: </xsl:text>
      <xsl:value-of select="."/>
    </li>
  </xsl:template>

  <!-- giNTP -->
  <xsl:template match="giNTP">
  <xsl:text>NTP Server</xsl:text>
    <ul>
      <xsl:apply-templates select="gin"/>
    </ul>
  </xsl:template>

  <!-- gin -->
  <xsl:template match="gin">
    <li>
      <xsl:choose>
        <xsl:when test="@type[.='IP']">
          <xsl:text>IP</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='MAC']">
          <xsl:text>MAC</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Stratum']">
          <xsl:text>Startum</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Poll']">
          <xsl:text>Polling Interval [s]</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='Precision']">
          <xsl:text>Precision [s]</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='RootDelay']">
          <xsl:text>Root Delay [s]</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='RootDisp']">
          <xsl:text>Root Dispersion [s]</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='ReferenceTstamp']">
          <xsl:text>Reference Timestamp</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='OriginateTstamp']">
          <xsl:text>Originate Timestamp</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='ReceiveTstamp']">
          <xsl:text>Receive Timestamp</xsl:text>
        </xsl:when>
        <xsl:when test="@type[.='TransmitTstamp']">
          <xsl:text>Transmit Timestamp</xsl:text>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>?</xsl:text>
        </xsl:otherwise>
      </xsl:choose>

      <xsl:text>: </xsl:text>
      <xsl:value-of select="."/>
    </li>
  </xsl:template>

<!-- wmiInfo -->
  <xsl:template match="wmiInfo">
    <div class="{name(.)}">
      <b>
        <xsl:text>Windows Management Instrumentation</xsl:text>
      </b>
      <br/>
      <br/>
      <xsl:apply-templates select="wmiInfoOS"/>
      <xsl:apply-templates select="wmiInfoQFE"/>
      <xsl:apply-templates select="wmiInfoShare"/>
      <xsl:apply-templates select="wmiInfoProcessor"/>
      <xsl:apply-templates select="wmiInfoPhysicalMemory"/>
      <xsl:apply-templates select="wmiInfoDiskDrive"/>
      <xsl:apply-templates select="wmiInfoDiskPartition"/>
      <xsl:apply-templates select="wmiInfoCDROMDrive"/>
      <xsl:apply-templates select="wmiInfoVideoController"/>
      <xsl:apply-templates select="wmiInfoDesktopMonitor"/>
      <xsl:apply-templates select="wmiInfoUserAccount"/>
      <xsl:apply-templates select="wmiInfoGroup"/>
    </div>
  </xsl:template>

  <!-- wmiInfoOS -->
  <xsl:template match="wmiInfoOS">
    <xsl:text>Operating System</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoQFE -->
  <xsl:template match="wmiInfoQFE">
    <xsl:text>Quick Fix Engineering</xsl:text>
    <xsl:if test="@cnt">
      <xsl:text> (</xsl:text>
      <xsl:value-of select="@cnt"/>
      <xsl:text>)</xsl:text>
    </xsl:if>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoShare -->
  <xsl:template match="wmiInfoShare">
    <xsl:text>Shares</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoProcessor -->
  <xsl:template match="wmiInfoProcessor">
    <xsl:text>Processor</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoPhysicalMemory -->
  <xsl:template match="wmiInfoPhysicalMemory">
    <xsl:text>Memory</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoDiskDrive -->
  <xsl:template match="wmiInfoDiskDrive">
    <xsl:text>Disk drive</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoDiskPartition -->
  <xsl:template match="wmiInfoDiskPartition">
    <xsl:text>Disk partition</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoCDROMDrive -->
  <xsl:template match="wmiInfoCDROMDrive">
    <xsl:text>CDROM drive</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoVideoController -->
  <xsl:template match="wmiInfoVideoController">
    <xsl:text>Video Controller</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoDesktopMonitor -->
  <xsl:template match="wmiInfoDesktopMonitor">
    <xsl:text>Monitor</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoUserAccount -->
  <xsl:template match="wmiInfoUserAccount">
    <xsl:text>User Accounts</xsl:text>
    <xsl:if test="@cnt">
      <xsl:text> (</xsl:text>
      <xsl:value-of select="@cnt"/>
      <xsl:text>)</xsl:text>
    </xsl:if>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoGroup -->
  <xsl:template match="wmiInfoGroup">
    <xsl:text>Groups</xsl:text>
    <xsl:if test="@cnt">
      <xsl:text> (</xsl:text>
      <xsl:value-of select="@cnt"/>
      <xsl:text>)</xsl:text>
    </xsl:if>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- wmiInfoObject -->
  <xsl:template match="wmiInfoObject">
    <ul>
      <xsl:apply-templates select="wmiInfoValue"/>
    </ul>
  </xsl:template>

  <!-- wmiInfoValue -->
  <xsl:template match="wmiInfoValue">
    <li>
      <b>
        <xsl:value-of select="@name"/>
        <xsl:text>: </xsl:text>
      </b>
      <xsl:value-of select="."/>
    </li>
  </xsl:template>
</xsl:stylesheet>
